package com.neu.questionnaire_system.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * created by libo 注册+重置密码
 */
@Mapper
public interface RegisterMapper {

    //根据传入的注册类型type确定注册哪一类调用特定的数据库
    List<Map<String,Object>> registerTenant();

    List<Map<String,Object>> registerUser();

    List<Map<String,Object>> registerAdmin();

    @Update("update user set password=#{password}where userName=#{userName,jdbcType=VARCHAR} and isDeleted='0'")
    int resetUserInfo(@Param("userName")String userName,@Param("password")String password);

    @Update("update tenant set password=#{password}where tenantName=#{tenantName,jdbcType=VARCHAR}")
    int resetTenantInfo(@Param("tenantName")String userName,@Param("password")String password);

    @Update("update answer set password=#{password}where answerName=#{answerName,jdbcType=VARCHAR}")
    int resetAnswerInfo(@Param("answerName")String userName,@Param("password")String password);



}
